import request from '@/utils/request'
// 获取房产列表
export function getProperties(params) {
  return request({
    url: '/properties',
    method: 'get',
    params
  })
}
// 删除房产
export function delProperty(id) {
  return request({
    url: `/properties/${id}`,
    method: 'delete'
  })
}

// 获取指定房产
export function getPropertyById(id) {
  return request({
    url: `/properties/${id}`,
    method: 'get'
  })
}
// 获取房产数量
export function getPropertyCount() {
  return request({
    url: `/properties/count`,
    method: 'get'
  })
}

// 添加房产
export function addproperty(data) {
  return request({
    url: `/properties`,
    method: 'post',
    data
  })
}

// 编辑房产
export function delproperty(data) {
  return request({
    url: `/properties/${data.id}`,
    method: 'put',
    data
  })
}
